﻿using UnityEngine;
using System.Collections;

public class Camera_the_game : MonoBehaviour 
{
	public GameObject player;

	// Use this for initialization
	void Start ()
	{
		//player = GameObject.FindGameObjectWithTag("Player");
	
	}
	
	// Update is called once per frame
	void Update () 
	{
		if(player.transform.position.y > transform.position.y )
		{
			transform.position = new Vector3(transform.position.x, player.transform.position.y  ,transform.position.z);
		}

		/*if(Input.GetKey(KeyCode.S) && player.transform.position.y < transform.position.y  )
		{
			transform.position = new Vector3(transform.position.x, player.transform.position.y ,transform.position.z);
		}*/

		if(transform.position.y > 18)
		{
			transform.position = new Vector3(transform.position.x, player.transform.position.y ,transform.position.z);
		}
		//transform.position = new Vector3(transform.position.x, player.transform.position.y +4 ,transform.position.z); 
	}
}
